* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    padding-bottom: 60px;
    background-color: #f0f2f5;
}

header {
    background-color: #333;
    color: white;
    padding: 1rem;
    text-align: center;
}

nav ul {
    list-style: none;
    padding: 1rem 0;
}

nav ul li {
    display: inline;
    margin: 0 1rem;
}

nav ul li a {
    color: white;
    text-decoration: none;
}

nav ul li a:hover {
    color: #ddd;
}

main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    margin-top: 1rem;
}

footer {
    background-color: #2d3748;
    color: #e2e8f0;
    text-align: center;
    padding: 0.8rem;
    font-size: 0.8rem;
}

.profile-container {
    background: linear-gradient(to right, #2d3748, #4a5568);
    padding: 0.8rem 2rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.profile-image {
    display: none;
}

.profile-info {
    flex: 1;
    text-align: left;
    max-width: 800px;
}

.profile-info h1 {
    margin-bottom: 0.6rem;
    font-size: 1.8rem;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: flex-start;
}

.social-links a {
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.4rem 1.2rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.social-links a:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateX(5px);
}

.game-nav {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    padding: 0.6rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.game-categories {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.category {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
}

.category i {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 0.3rem;
}

.category span {
    font-size: 0.85rem;
    color: #444;
    font-weight: 500;
}

.category:hover {
    background-color: #edf2f7;
    transform: translateY(-2px);
}

.category.active {
    background-color: #4299e1;
    color: white;
    box-shadow: 0 2px 8px rgba(66, 153, 225, 0.3);
}

.category.active i,
.category.active span {
    color: white;
}

.games-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.2rem;
    padding: 1.2rem;
    background: #f8fafc;
}

.game-card {
    position: relative;
    background: white;
    border-radius: 10px;
    overflow: visible;
    transition: all 0.3s ease;
    border: 1px solid #edf2f7;
}

.game-content {
    cursor: pointer;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.game-content:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
}

.game-image {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.game-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
}

.game-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.game-info {
    padding: 1rem;
}

.game-info h3 {
    color: #2d3748;
    font-size: 1rem;
    margin-bottom: 0.4rem;
}

.game-category {
    font-size: 0.8rem;
    color: #718096;
}

.game-description {
    font-size: 0.85rem;
    color: #4a5568;
    line-height: 1.4;
    margin: 0.5rem 0;
}

.game-meta {
    display: flex;
    justify-content: space-between;
    padding-top: 0.8rem;
    border-top: 1px solid #eee;
}

.game-meta span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #666;
}

.game-meta i {
    color: #f1c40f;
}

/* 添加媒体查询来处理移动端样式 */

/* 平板电脑和小屏幕电脑 (768px 及以下) */
@media screen and (max-width: 768px) {
    /* 个人信息区域调整 */
    .profile-container {
        padding: 1rem;
    }

    .profile-info {
        text-align: left;
    }

    .profile-info h1 {
        font-size: 1.4rem;
    }

    .social-links a {
        font-size: 0.85rem;
        padding: 0.3rem 1rem;
    }

    /* 游戏分类导航调整 */
    .game-categories {
        gap: 0.8rem;
    }

    .category {
        padding: 0.3rem 0.6rem;
    }

    .category i {
        font-size: 1rem;
    }

    .category span {
        font-size: 0.75rem;
    }

    /* 游戏卡片容器调整 */
    .games-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
        padding: 0.5rem;
    }

    .game-count {
        font-size: 0.85rem;
        padding: 0.3rem 1rem;
    }

    .game-count strong {
        font-size: 1rem;
    }
}

/* 手机端 (480px 及以下) */
@media screen and (max-width: 480px) {
    /* 个人信息进一步精简 */
    .profile-image img {
        width: 80px;
        height: 80px;
    }

    .social-links {
        font-size: 0.8rem;
    }

    /* 游戏分类导航改为滚动条 */
    .game-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .game-categories {
        flex-wrap: nowrap;
        padding: 0.5rem;
        gap: 0.8rem;
        justify-content: flex-start;
        min-width: min-content;
    }

    /* 游戏卡片调整 */
    .games-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .game-card {
        margin: 0 0.5rem;
    }

    .game-info {
        padding: 1rem;
    }

    .game-info h3 {
        font-size: 1.1rem;
    }

    .game-description {
        font-size: 0.8rem;
    }

    /* 页脚调整 */
    footer {
        position: relative;
        padding: 0.8rem;
        font-size: 0.8rem;
    }

    .profile-container {
        padding: 1rem 0.5rem;
    }

    .profile-info {
        text-align: left;
    }

    .social-links {
        align-items: flex-start;
    }
}

/* 确保页面在任何设备上都有合适的内边距 */
body {
    padding-bottom: 60px; /* 为固定底部的页脚留出空间 */
}

/* 优化触摸体验 */
@media (hover: none) {
    .category:hover {
        transform: none;
    }

    .game-card:hover {
        transform: none;
    }

    .game-card:hover .game-image img {
        transform: none;
    }

    .game-card:active {
        background-color: #f8f9fa;
    }
}

/* 添加滚动条样式 */
.game-nav::-webkit-scrollbar {
    height: 4px;
}

.game-nav::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.game-nav::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 2px;
}

.game-nav::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 添加游戏数量样式 */
.game-count {
    color: #fff;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.4rem 1.2rem;
    border-radius: 20px;
    align-self: center;
}

.game-count strong {
    font-size: 1.1rem;
    margin-left: 0.2rem;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    .game-count {
        font-size: 0.85rem;
        padding: 0.3rem 1rem;
    }
    
    .game-count strong {
        font-size: 1rem;
    }
}

/* 模态框样式 */
.game-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 1000;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.modal-content {
    position: relative;
    width: 100%;
    height: 100vh;
    margin: 0;
    background: rgba(26, 26, 26, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    z-index: 1001;
    padding: 2rem;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #333;
}

/* 手机框架样式 */
.phone-frame {
    flex: none;
    width: 750px;
    height: 1334px;
    background: #2c3e50;
    border-radius: 40px;
    padding: 15px;
    position: relative;
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 30px;
    overflow: hidden;
    position: relative;
}

.phone-screen iframe {
    width: 100%;
    height: 100%;
    border: none;
    transform-origin: top left;
    transform: scale(1);
}

/* 添加手机刘海和Home键样式 */
.phone-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 25px;
    background: #2c3e50;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    z-index: 2;
}

.phone-frame::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    z-index: 2;
}

/* 二维码样式 */
.qr-code {
    position: absolute;
    right: -420px;
    top: 50px;
    width: 350px;
    height: 450px;
    padding: 3rem;
    background: #2c3e50;
    border-radius: 25px;
    text-align: center;
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#qrContainer {
    width: 280px;
    height: 280px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
}

#qrContainer img {
    width: 100% !important;
    height: 100% !important;
    display: block;
    margin: auto;
}

.qr-code p {
    color: #fff;
    font-size: 1.8rem;
    margin-top: 2.5rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    .qr-code {
        position: relative;
        right: auto;
        top: auto;
        width: 320px;
        height: 400px;
        padding: 2rem;
    }

    #qrContainer {
        width: 250px;
        height: 250px;
    }

    .qr-code p {
        font-size: 1.6rem;
        margin-top: 2rem;
    }
}

@media screen and (max-width: 1200px) {
    .preview-wrapper {
        transform: scale(0.7);
    }
}

@media screen and (max-width: 768px) {
    .preview-wrapper {
        flex-direction: column;
        transform: scale(0.45);
        gap: 2rem;
        align-items: center;
    }

    .qr-code {
        position: relative;
        right: auto;
        top: auto;
        transform: scale(1.2);
    }
}

@media screen and (max-height: 800px) {
    .preview-wrapper {
        transform: scale(0.4);
    }
}

/* 微信链接相对定位 */
.wechat-link {
    position: relative;
}

/* 微信二维码样式 */
.wechat-qr {
    position: absolute;
    right: -204px;
    top: -55px;
    transform: scale(0.7);
    transform-origin: left top;
    background: none;
    padding: 0;
    box-shadow: none;
    display: none;
    z-index: 1000;
    width: 200px;
    text-align: center;
}

.wechat-qr img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.wechat-qr p {
    display: none;
}

.wechat-qr::before {
    display: none;
}

/* 悬浮效果 */
.wechat-link:hover .wechat-qr {
    display: block;
}

/* 移动端隐藏二维码 */
@media screen and (max-width: 768px) {
    .wechat-qr {
        display: none !important;
    }
}

/* 调整位置以补偿缩放 */
.wechat-qr {
    right: -200px;
}

/* 移除旧的微信二维码相关样式 */
.wechat-qr, .wechat-link {
    display: none;
}

/* 社交项目样式 */
.social-item {
    display: flex !important;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.4rem;
}

.social-item a {
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.4rem 1.2rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.social-item a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

/* 复制按钮样式 */
.copy-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    padding: 0.35rem 0.8rem;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.copy-btn::before {
    content: '复制';
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.copy-btn i {
    font-size: 0.8rem;
    opacity: 0.9;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.copy-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 复制成功提示样式 */
.copy-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10000;
}

.copy-toast.show {
    opacity: 1;
    visibility: visible;
} 